package com.test3;

public class JiangShi {
    String name;
    int hp;
    int attack;

    public JiangShi(String name, int hp,int attack) {
        this.name = name;
        this.hp = hp;
        this.attack=attack;
    }

   public void eat(Zhiwu zw){
       System.out.println(this.name+"正在吃"+zw.name+"植物");
       zw.hp=this.attack;
       System.out.println("植物血量；"+zw.hp);
   }
}
